/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.sql.SQLException;
import java.sql.Statement;
import model.Professor;

/**
 *
 * @author Gustavo Pereira
 */
public class GerenciadorProfessor {
    public  boolean criar(Professor prof)
{
    int retorno = 0 ;
    boolean passou= false;
    try {
            GerenciadorBanco.conect();
            Statement stm = GerenciadorBanco.conn.createStatement();
            retorno= stm.executeUpdate("insert into professor (nome,sobrenome,rg,telefone,celular,email) values ('"+prof.nome+"','"+prof.sobrenome+"','"+prof.rg+"','"+prof.telefone+"','"+prof.celular+"','"+prof.email+"');");
            passou = (retorno>0);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
         finally{   
    GerenciadorBanco.desconect();}
    return passou;
}
    public boolean editar()
    {
        return true;
    }
    public boolean excluir()
    {
        return true;
    }
    
}
